#include <iostream>
#include <stdio.h>
#include <cmath>

using namespace std;

int c[1000];
int d[1000];
int e[1000];
int main() {
    string a = "";
    string b = "";
    cin >> a >> b;
    int len1 = a.length();
    int len2 = b.length();
    int flag = 0;
    if((len1 < len2)||(len1 == len2 && a < b)){
        swap(a,b);
        flag = 1;
        len1 = a.length();
        len2 = b.length();
    }
    for(int i = 0; i < len1; i++){
        c[i] = int(a[len1-i-1])-48;
    }
    for(int i = 0; i < len2; i++){
        d[i] = int(b[len2-i-1])-48;
    }
    int t = 0;
    for(int i = 0; i < len1; i++){
        e[i] = c[i]-d[i]-t;
        
        if(e[i] < 0){
            e[i] = c[i]+10-d[i]-t;
            t = 1;
        }
        else{
            t = 0;
        }
    }
    
    int m = 0;
    for(int i = 999; i >= 0; i--){
        if(e[i] == 0){
            m+=1;
        }
        else{
            break;
        }
    }
    if(flag){
        cout << '-';
    }
    for(int i = 0; i <= 999-m; i++){
        cout << e[999-m-i];
    }
    return 0;
}